package com.eugene.scheduler;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by HOME on 29.01.14.
 */
public class DateInfo {
    static Context context;
    static int getDateInfo(Date date){
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
        String name = sdf.format(date);
        return sp.getInt(name,-1);
    }

    static void setDateInfo(Date date, int info) {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
        String name = sdf.format(date);
        sp.edit().putInt(name, info).apply();
    }
}
